//
//  TongzhiViewController.m
//  Yu01
//
//  Created by 蒋松涵 on 16/8/24.
//  Copyright © 2016年 蒋松涵. All rights reserved.
//

#import "TongzhiViewController.h"
#import "NoticeTableViewCell.h"

@interface TongzhiViewController ()<UITableViewDataSource,UITableViewDelegate>
{
    UIWebView* webView;

}
@property (retain , nonatomic)UITableView * tableView;



@end

@implementation TongzhiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
//    [self tableview];
    [self init_WebView];
}

#pragma mark - WebView
-(void)init_WebView
{
    //加载网页
    webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
    
    webView.scalesPageToFit = YES;//自动对页面进行缩放以适应屏幕
    webView.detectsPhoneNumbers = YES;//自动检测网页上的电话号码，单击可以拨打
    
    [self.view addSubview:webView];
    
    
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.NotURL]]];
    
    [webView goBack];
    [webView goForward];
    [webView reload];

}

#pragma mark - tableview
-(void)tableview
{
    CGFloat h = 736 / ScreenHeight;
//    CGFloat w = 414 / ScreenWidth;
    
    self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight) style:UITableViewStylePlain];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.rowHeight = 483/h;
    [self.view addSubview:self.tableView];
    
    [self.tableView registerNib:[UINib nibWithNibName:@"NoticeTableViewCell"bundle:nil] forCellReuseIdentifier:@"cell"];
}
#pragma mark - TableView的代理方法
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NoticeTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell)
    {
        cell = [[NoticeTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    }
    
    return cell;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
